<?php
class template_guest_list extends theme
{
	
	protected function head()
	{
	?>
<link type="text/css" rel="stylesheet" href="templates/project/css/project.css">

<script type="text/javascript" language="javascript" src="templates/project/js/project.js"></script>
	<?php
	}

	protected function center()
	{
		$projects = $this->get('projects');
		?>
<div class="center-title">开发中的项目</div>
<div class="center-content">

<div class="project-list">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr height="25">
	<th align="left">项目名</th>
	<th align="center" width="100">客户</th>
	<th align="center" width="100">项目负责人</th>
	<th align="center" width="75">任务数</th>
	<th align="center" width="110">总体进度</th>
	<th align="center" width="110">创建时间</th>
</tr>

<?php
if(count($projects))
{
$i=0;
foreach($projects as $project)
{
$customer = bone::get_user($project->customer_id);
$manager = bone::get_user($project->manager_id);
?>
<tr height="25" class="row-<?php echo $i; ?>">
	<td align="left">
	<a href="<?php echo url('./?controller=project&task=guest_detail&project_id='.$project->id.'&menu_id='.$this->get('menu_id') ); ?>" title="<?php echo $project->name; ?>">
	<?php echo $project->name; ?>
	</a>
	</td>
	<td align="center"><?php echo $customer->name; ?></td>
	<td align="center">
	<a href="<?php echo url('./?controller=team&task=user_detail&user_id='.$project->manager_id); ?>" title="<?php echo $manager->name; ?>">
	<?php echo $manager->name; ?>
	</a>
	</td>
	<td align="center"><?php echo $project->completed_ticket_count .'/'. $project->ticket_count; ?></td>
	<td align="center"><div class="progress"><div class="bg"><div class="bar" style="width:<?php echo $project->progress<5?'5':$project->progress;?>px;"></div></div></div></td>
	<td align="center"><?php echo date('Y-m-d',$project->create_time); ?></td>
</tr>
<?php
$i = 1-$i;
}
}
else
{
?>
<tr height="25">
	<td colspan="6" align="center">暂无记录</td>
</tr>
<?php
}
?>
</table>
</div>

</div>

<div class="center-title">近期完工的项目</div>
<div class="center-content">

<div class="project-list">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr height="25">
	<th align="left">项目名</th>
	<th align="center" width="120">网址</th>
	<th align="center" width="100">客户</th>
	<th align="center" width="110">完工时间</th>
	<th align="center" width="60">客户评价</th>
</tr>
<tr height="25">
	<td colspan="5" align="center">暂无记录</td>
</tr>
</table>
</div>
</div>

		<?php
	}		
		

}
?>